package com.danskin.wechat.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.danskin.wechat.entity.CustOrderDetail;
import com.danskin.wechat.entity.CustOrderRecord;
import com.danskin.wechat.entity.example.CustOrderRecordExample;
import com.danskin.wechat.util.Page;

public interface CustOrderRecordDao {

	List<CustOrderRecord> listPageByOpenId(Page page);

	CustOrderRecord selectByIdAndOpenId(@Param("id") Integer id, @Param("openId") String openId);

	int countByExample(CustOrderRecordExample example);

	int deleteByExample(CustOrderRecordExample example);

	int deleteByPrimaryKey(Integer id);

	int insert(CustOrderRecord record);

	int insertSelective(CustOrderRecord record);

	List<CustOrderRecord> selectByExample(CustOrderRecordExample example);

	CustOrderRecord selectByPrimaryKey(Integer id);

	int updateByExampleSelective(@Param("record") CustOrderRecord record,
			@Param("example") CustOrderRecordExample example);

	int updateByExample(@Param("record") CustOrderRecord record, @Param("example") CustOrderRecordExample example);

	int updateByPrimaryKeySelective(CustOrderRecord record);

	int updateByPrimaryKey(CustOrderRecord record);

	CustOrderRecord findCustOrderRecord(@Param("appId") String appId, @Param("openId") String openId,
			@Param("orderNo") String orderNo);

	List<CustOrderDetail> queryCustOrderDetail(@Param("orderNo") String orderNo);

	/**
	 * 根据年份和CustEx查询 年度使用金额
	 * 
	 * @param record
	 * @return
	 */
	Double selectPayAmountByYear(CustOrderRecord record);
}